#ifndef CLIECT_H
#define CLIECT_H

#include <QObject>
#include <stdio.h>
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

#include "config.h"
#include "cJSON.h"
#include <QDebug>

extern char SERVER_IP[30];

class Cliect : public QObject
{
    Q_OBJECT
public:
    static Cliect *get()
    {
        static Cliect c;
        return &c;
    }

    explicit Cliect(QObject *parent = nullptr);

    int socketfd;
    void *recv_data();
    void send_file(const char *path, std::string);
    void download_file(char *data);
    void Send_Msg(Package_t pack);
signals:
    void sigFileList(QString);
    void sigDelFile(QString);
    void sigCmd(QString);
};

#endif // CLIECT_H
